jwplayer().registerPlugin('like', function(player, config, like){
	this.resize = function (width, height){
		if (player.getRenderingMode() == "html5"){
		var playerWidthPX2 = width;
		var playerWidthPX = parseFloat(playerWidthPX2);
		var playerHeightPX2 = height;
		var playerHeightPX = parseFloat(playerHeightPX2);
		like = function(){
			if(player.getFullscreen() != true){
			if(player.getState() == "IDLE"){
			}
			if(player.getState() == "PAUSED"){
				player.play();
			}
			if(player.getState() == "PLAYING"){
				player.pause();
			}
			var theUrl = window.location;
			var el = document.createElement("iframe");
			if (navigator.appName.indexOf("Microsoft") != -1) {
			var btn = document.createElement('input');
			} else {
			var btn = document.createElement('img');
			}
			var el2 = document.createElement("div");
			try{
			theBody.removeChild(document.getElementById("div"));
			}
			catch(err){
			}
			var el3 = document.createElement("div");
			el3.setAttribute('id', 'divB');
			if (navigator.userAgent.match(/iPad/i) != null || navigator.userAgent.match(/iPhone/i) != null){
			el3.style.height = playerHeightPX + "px";
			} else {
			el3.style.height = playerHeightPX + 30 + "px";
			}
			el3.style.width = playerWidthPX2;
			el3.style.background = "#333333";
			el3.style.opacity = "0.75";
			el3.style.position = "relative";
			el3.style.zIndex = "999";
			//5.7
			if(jwplayer.version == "5.7.1896" && player.getState() == "IDLE")
			{
				el3.style.top = "-" + playerHeightPX + "px";
			}
			if(jwplayer.version == "5.7.1896" && player.getState() == "PLAYING")
			{
				el3.style.top = playerHeightPX + "px";
			}
			el3.width = playerWidthPX;
			el3.height = playerHeightPX;
			el2.setAttribute('id', 'div');
			el2.style.height = "110px";
			el2.style.width = "342px";
			el2.style.background = "#ECEEF5";
			el2.style.border = "1px solid #748BB8";
			el2.style.position = "absolute";
			el2.style.zIndex = "999";
			el2.width = "342";
			el2.height = "110";
			var theBody = document.getElementById(player.id);
			theBody.appendChild(el3); 
			theBody.appendChild(el2); 
			el2.style.display = "table";
			el2.style.textAlign = "center";
			el2.style.left = playerWidthPX2 - (playerWidthPX2/2) - (el2.width/2)+"px";
			el2.style.top = playerHeightPX2 - (playerHeightPX2/2) - (el2.height/2)+"px";
			el.setAttribute('id', 'ifrm');
			el.style.height = "100px";
			el.style.width = "332px";
			el.style.background = "#FFFFFF";
			el.style.border = "1px solid #8DA0C6";
			el.style.position = "relative";
			el.setAttribute('frameBorder', '0');
			el.style.top = "4px";
			//IE9
			if(typeof document.documentElement.style.opacity!='undefined'){
			el.style.display = "block";
			} else {
			el.style.display = "table";
			}
			el.style.left = "4px";
			el.style.textAlign = "center";
			el.style.marginBottom = "-16px";
			el.style.paddingTop = "5px";
			el.style.paddingLeft = "5px";
			el.style.marginRight = "8px";
			el2.appendChild(el);
			el.setAttribute('src', 'http://www.facebook.com/plugins/like.php?href='+ theUrl);
			btn.setAttribute('id', 'btn'+player.id);
			btn.setAttribute('src','');
			btn.onmouseover = function() {document.getElementById('btn'+player.id).setAttribute('src','%3D%3D');}
			btn.onmouseout = function() {document.getElementById('btn'+player.id).setAttribute('src','');}
			btn.onmousedown = function() {document.getElementById('btn'+player.id).setAttribute('src','%3D');}
			btn.setAttribute('name','X');
			btn.setAttribute('value','X');
			btn.style.position = "relative";
			btn.style.width = "25px";
			btn.style.height = "25px";
			btn.style.cursor = "pointer";
			btn.width = "25";
			btn.height = "25";
			btn.style.left = ((document.getElementById("div")).width/2)-20+"px";
			btn.style.top = "-82px";
			el2.appendChild(btn);
			btn.addEventListener('click',function () {
			theBody.removeChild(el2);
			theBody.removeChild(el3);
			if(player.getState() == "PAUSED"){
				player.play();
				}
				},false)
			}
		}
		player.getPlugin("dock").setButton(
            'like',
            like,
            ''
        );
	};
	}
	//flash fallback
}, 'like-1');